"use strict";
exports.__esModule = true;
var data_1 = require("./data");
// 类 泛型
var Tree = /** @class */ (function () {
    function Tree(list, option) {
        // 默认参数
        var defaultOption = {
            openSubChildren: true
        };
        // 合并参数
        option = Object.assign(defaultOption, option);
        this.option = option;
        this.list = list;
    }
    // 初始化
    Tree.prototype.init = function () {
        this.render(this.list);
    };
    Tree.prototype.render = function (list) {
        this.option.root.innerHTML = "\n      <ul>\n        ".concat(list.map(function (v) {
            return "<li>".concat(v.name, "</li>");
        }), "\n      </ul>\n    ");
    };
    // 私有方法
    Tree.prototype.sayList = function () {
        console.log(this.list);
    };
    return Tree;
}());
new Tree(data_1["default"], {
    root: document.querySelector('#root')
});
